package com.xxx.ticket;

/**
 * @version v1.0
 * @Description
 * @Author admin
 * @date 2021/7/30  10:40
 * @Copyright
 */
public class ticket01 extends Thread {
    public static int nnum = 100;
    public boolean f = true;

    @Override
    public void run() {
        while (f) {
            if (nnum > 0) {
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println(Thread.currentThread().getName() + ": " + nnum--);
            } else {
                f = false;
            }
        }
    }
}